#ifndef _AUDIO_CODEC_H
#define _AUDIO_CODEC_H

#include "base.h"
#include "G711Codec.h"
#include "speexcodec.h"

class CAudioCodec
{
public:
	CAudioCodec(G7XXPCM_CMD nType);
	virtual ~CAudioCodec();
public:
	bool Enc_Audio(int nCh, unsigned char* pIn, int nInLen, unsigned char* pOut, int &nOutLen);
	bool Dec_Audio(unsigned char* pIn, int nInLen, unsigned char* pOut, int &nOutLen);
	int GetFrameSamples(G7XXPCM_CMD nType, int nCh);
private:
	void AudioCodec(G7XXPCM_CMD EncCmd, G7XXPCMPARAMIN* ParamIn, G7XXPCMPARAMOUT* ParamOut);
private:
	CG711Codec m_g711;
	CSpeexCodec m_speex;
	G7XXPCM_CMD m_defAudioEncode, m_defAudioDecode, m_defUnInit;

};

#endif

